package main

import "fmt"

var s []int

var ss []int = make([]int, 3, 5)


func slice()  {
	ss = append(ss,1)
	printSlice(ss)
	ss = append(ss,2)
	printSlice(ss)
	ss = append(ss,3,4)
	printSlice(ss)
	ss = append(ss,5,6,7,8)
	printSlice(ss)

	s = append(s,10)
	printSlice(s)
	copy(ss, s)
	printSlice(ss)
	
	fmt.Println("ss[3:6] == ", ss[3:6])

}

func printSlice(s []int){
	fmt.Printf("len=%d cap=%d %v\n",len(s),cap(s),s)
}